<template>
  <div class="eq-time-box">
    <div class="eq-time-title" :style="back">
      <p class="eq-time-title-des">本月总收益</p>
      <p class="eq-time-title-num">
        <span class="fuhao">¥</span>
        {{money.totalrevenue}}
      </p>
      <div class="tm-box">
        <div class="eq-time-money fleft">
          <p class="eq-time-money-title">在线支付</p>
          <p class="eq-time-money-des">{{money.line}}</p>
        </div>
        <div class="eq-time-money fright">
          <p class="eq-time-money-title">卡支付</p>
          <p class="eq-time-money-des">{{money.card}}</p>
        </div>
      </div>
    </div>

    <div class="date-list List">
      <mu-list>
        <mu-list-item v-for="(item,index) in timeList" :key="index" >
          <mu-list-item-content @click="singclick(item.createTime)">
            <mu-list-item-title>
              <span class="fleft">{{item.createTime}}</span>

              <div class="_clear"></div>
            </mu-list-item-title>
            <mu-list-item-sub-title>
              <div class="fleft">
                <span class="xs-box">线上</span>
                <span>¥{{item.lineOrdergold}}</span>
              </div>
              <div class="fleft">
                <span class="xx-box">线下</span>
                <span>¥{{item.cardOrdergold}}</span>
              </div>
              <div class="_clear"></div>
            </mu-list-item-sub-title>
          </mu-list-item-content>
        </mu-list-item>
      </mu-list>
       <div v-show="nolist" class="nolist">
          <span class="iconfont icon-charging"></span>
          <p>暂无记录</p>
        </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      money:{
        line:0,
        card:0,
        totalrevenue:0
      },
      timeList: [],
      nolist:true,
      totalrevenue: 5255,
      back: {
        background: "url(" + require("../../../assets/image/bg3.png") + ")",
        backgroundRepeat: "no-repeat",
        backgroundSize: "cover"
      }
    };
  },
  methods: {
    singclick(date) {
        this.$router.push({
        path: "/admin/bil",
         query: {
            date: date
          }
      });
    }
  },

  mounted() {
      this.$api.getMonProfit().then(res=>{
        console.log(res)
      this.money.line = res.data.data.lineOrdergold;
      this.money.card = res.data.data.cardOrdergold;
      this.money.totalrevenue = res.data.data.sumOrdergold;
      this.timeList = res.data.data.profits;
      
    })
  },
  watch:{
        timeList: function(v) {
      if (v == "") {
        this.nolist = true;
      } else {
        this.nolist = false;
      }
    }
  },
  
};
</script>

<style>
</style>